<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
      xmlns:th="http://www.thymeleaf.org" th:fragment="header">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>thyemleaf in action</title>

    <!-- CSRF -->
    <meta name="_csrf" th:content="${_csrf.token}"/>
    <!-- default header name is X-CSRF-TOKEN -->
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>

    <!-- Tether core CSS -->
    <link href="../../css/tether.min.css" th:href="@{/css/tether.min.css}" rel="stylesheet">

    <!-- Bootstrap core CSS -->
    <link href="../../dist/css/bootstrap.min.css" th:href="@{/dist/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Bootstrap CSS -->
    <!--     <link href="../../css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"> -->
    <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"-->
          <!--crossorigin="anonymous">-->

    <!-- Custom styles for this template -->
    <link href="../../css/carousel.css" th:href="@{/css/carousel.css}" rel="stylesheet">

    <!-- Font-Awesome CSS -->
    <link href="../../css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet">

    <!-- NProgress CSS -->
    <link href="../../css/nprogress.css" th:href="@{/css/nprogress.css}" rel="stylesheet">

    <!-- thinker-md CSS -->
    <link href="../../css/thinker-md.vendor.css" th:href="@{/css/thinker-md.vendor.css}" rel="stylesheet">

    <!-- bootstrap tags CSS -->
    <link href="../../css/component-tageditor.min.css" th:href="@{/css/component-tageditor.min.css}" rel="stylesheet">

    <!-- bootstrap chosen CSS -->
    <link href="../../css/component-chosen.min.css" th:href="@{/css/component-chosen.min.css}" rel="stylesheet">

    <!-- Custom styles -->
    <link href="../../css/style.css" th:href="@{/css/style.css}" rel="stylesheet">
    <link href="../../css/thymeleaf-bootstrap-paginator.css" th:href="@{/css/thymeleaf-bootstrap-paginator.css}"
          rel="stylesheet">
    <link href="../../css/blog.css" th:href="@{/css/blog.css}" rel="stylesheet">

</head>
<body>
    <header>
        <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
            <a class="navbar-brand" href="/" th:href="@{~/}">咖啡博客</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarCollapse">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item active">
                        <a class="nav-link" href="/users" th:href="@{~/users}">首页<span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">链接</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link disabled" href="#">关于</a>
                    </li>
                    <form class="form-inline mt-2 mt-md-0">
                        <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="搜索">
                        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
                    </form>
                </ul>

                <div sec:authorize="isAuthenticated()"  class="row" >
                    <div class="dropdown">
                        <a class=" dropdown-toggle" href="/u/waylau" th:href="@{'/u/' + ${#authentication.name}}" data-toggle="dropdown"><span sec:authentication="name"></span></a>
                        <div class="dropdown-menu" >
                            <a class=" dropdown-item" href="/u/waylau" th:href="@{'/u/' + ${#authentication.name}}">个人主页</a>
                            <a class="dropdown-item" href="/u/waylau/profile" th:href="@{'/u/' + ${#authentication.name}} + '/profile'" >个人设置</a>
                        </div>
                    </div>
                    <form action="/logout" th:action="@{/logout}" method="post">
                        <input class="btn btn-outline-success " type="submit" value="退出">
                    </form>
                </div>

                <div sec:authorize="isAnonymous()">
                    <a href="/login" class="btn btn-outline-success my-2 my-sm-0" type="submit">登录</a>
                    <a href="/register" class="btn btn-outline-success my-2 my-sm-0" type="submit">注册</a>
                </div>
            </div>
        </nav>
    </header>
</body>
</html>